
/**工具模块 */
module GameUtil {
	/**
 * 玩家信息--郭启航
 * 
*/
	export class PlayerMessage {
		private constructor() {
			this.initialize();
		}

		/**基础飞机数量*/
		public PlaneNum: number;
		/**AI购买的数组 */
		public AiPlane: any[] = [];
		/**Ai防御数组(string)*/
		public Aidefense: any[] = [];
		/**Ai防御数组(飞机)*/
		public AidefenseFly: any[] = [];
		/**Ai难度*/
		public AIdifficulty: number;
		/**是否是单人模式 */
		public onePerson: boolean = true;


		/**敌机配置文件 */
		public planeConfig: any[] = [];
		/**子弹配置文件*/
		public bulletConfig: any[] = [];
		/**玩家发射子弹*/
		public sendbullet: any[] = [];

		/**玩家发送敌机列表 */
		public sendEnemy: number[] = [];
		/**玩家接受敌机列表 */
		public getEnemy: number[] = [];

		/**己方溜掉的飞机*/
		public Game2addEnemy: number[] = [];
		/**敌方漏的飞机 */
		public EneMissList: number[] = [];
		/**己方基地 正在攻击*/
		public is_myTurryAtk: boolean = false;
		/**敌方基地 正在攻击*/
		public is_emyTurryAtk: boolean = false;
		/**空战飞机出发点 */
		public airBattlePosition: any[] = [];
		/**己方防守飞机出发点 */
		public defensePosition: any[] = [];
		/**敌方防守飞机出发点 */
		public enemyDefensePosition: any[] = [];
		/**地方基地血量*/
		public enemyHomeHp: number = 0;
		/**购买敌机总量限制*/
		public limitToBuyEnemy: number;
		/**基地血量*/
		public BaseHp: number = 10;
		/**基地位置*/
		public HomePoint: egret.Point = new egret.Point(320, 990);
		/**基地角度*/
		public HomeAngle: number = 0;
		/**基地子弹攻击力*/
		public HomeAtk: number;
		/**基地护盾是否存在*/
		public HomeShield: boolean;
		/**必杀Bool*/
		public HomeSlay: boolean;
		/**玩家单例 */
		public static instance: PlayerMessage;
		/**玩家金币数 */
		public money: number;
		/**准备计时*/
		public time: number = 60;
		/**玩家投资费用 */
		public investment: number;
		/**玩家血量*/
		public playHp: number;
		// /**玩家攻击力 */
		// public atk: number;
		// /**玩家护甲 */
		// public armor: number;
		// /**玩家攻速 */
		// public fire_speed: number;
		// /**玩家子弹发射排数 */
		// public bullet_row: number;
		/**玩家飞机位置 */
		public player_position: egret.Point = new egret.Point(0, 0);
		/**是否存在加速飞机 */
		public hasSpeedAdd: boolean = false;
		/**摇杆移动方向 */
		public joystick_direction: egret.Point = new egret.Point();
		/**游戏波次 */
		public game_turns: number;
		/**是否购买了僚机 */
		public isBuyGuard: boolean;
		/**僚机配置文件 */
		public Guard_PlaneConfig: any[];
		/**购买的僚机列表 */
		public BuyGuardArr: number[];
		/**是否购买环绕僚机 */
		public isBuyAroundPlane: boolean = false;
		/**是否购买跟随 僚机*/
		public isBuyFollowPlane: boolean = false;
		/**飞机总数 */
		public AllPlaneCount: number;
		/**摧毁的飞机数量 */
		public destoryCount:number;
		/**游戏是否结束 */
		public isGameOver: boolean = false;
		/**是否准备完毕进行下一回合 */
		public isReady: boolean = false;
		/**是否在战斗 */
		public isFight:boolean=false;
		/**玩家信息初始化 */
		public initialize() {
			this.isReady = false;
			this.PlaneNum = 20;
			this.destoryCount=0;
			//console.log("初始化");
		
			this.isGameOver = false;
			this.AIdifficulty = 0;
			this.limitToBuyEnemy = 100000000000000000;
			this.isBuyGuard = false;
			//this.BuyGuardArr = [];
			this.is_myTurryAtk = false;
			this.is_emyTurryAtk = false;
			this.isFight=false;
			this.HomeSlay = false;
			this.HomeShield = false;
			this.game_turns = 1;
			this.playHp = 4;
			this.time = 90;
			this.money = 0;
			this.investment = 0;
			this.sendEnemy = [];
			
			this.BaseHp = 10;
			this.enemyHomeHp = this.BaseHp;
			// this.atk = 1;
			// this.armor = 1;
			// this.fire_speed = 3;
			// this.bullet_row = 1;
			this.joystick_direction.x = 0;
			this.joystick_direction.y = 0;
			this.HomeAtk = 1;
			if (this.game_turns == 1) {
				this.AllPlaneCount = this.PlaneNum;
			}
		}
		/**静态单例构造方法 */
		public static createMsg(): PlayerMessage {

			if (PlayerMessage.instance == null) {
				PlayerMessage.instance = new PlayerMessage();
			}
			return PlayerMessage.instance;
		}
	}
}